package com.loong.job.handler;

import com.loong.system.service.ISystemConfigureService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SystemHandler {

    @DubboReference(timeout = 3000, retries = 1)
    private ISystemConfigureService systemConfigureService;

    @XxlJob("init_system_configure")
    public ReturnT<String> initSystemConfig(String param) {
        systemConfigureService.initAll();
        return new ReturnT(ReturnT.SUCCESS_CODE,"初始化成功");
    }
}
